/*
 * @Description: 
 * @Version: 1.0
 * @Author: tao
 * @Date: 2021-01-20 11:59:16
 * @LastEditors: tao
 * @LastEditTime: 2021-03-26 17:04:29
 */
import {
  request,
  IP
} from './request'

export function downloadFile() {
  let url = IP + "/user/stuTemplate"
  return request({
    url: url.replace(IP, ""),
    responseType: 'blob'
  })
}

export function uploadFile(data) {
  return request({
    url: `/user/stuExcelIn`,
    method: 'post',
    data
  })
}

export function getDataByPageAndSize(page = 1, size = 10) {
  return request({
    url: `/user/stuList`,
    params: {
      page,
      size
    }
  })
}

export function searchById(params) {
  return request({
    url: `/user/stuFind`,
    params
  })
}

export function editData(data) {
  return request({
    url: `/user/stuEdit`,
    method: 'post',
    data
  })
}

export function deleteById(id) {
  return request({
    url: `/user/stuDel?id=${id}`,
  })
}

export function appendData(data) {
  return request({
    url: `/user/stuAdd`,
    method: 'post',
    data
  })
}

export function initPassword(id) {
  return request({
    url: `/user/userPass?id=${id}`,
  })
}